package com.bdzl.daoRepository;

import java.util.List;

import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.bdzl.pojo.Feedback;

public interface FeedbackDao extends JpaRepository<Feedback, Integer> {

	List<Feedback> findByState(Integer i ,Pageable pageAble);

	Feedback findById(Integer feedbackId);

	
	@Modifying
	@Query(" update Feedback set state = 0 where id = :id ")
	void updatestate(@Param("id")Integer feedbackId);

	
	@Modifying
	@Query(" update Feedback set type = 1 where id = :id ")
	void updatetype(@Param("id")Integer feedbackId);

	@Query(" select count(f) from  Feedback f  where f.state = 1 ")
	Integer findcount();

	
	
	
}
